{% extends 'themes/default/public/layout.html' %}
{% block style %}
    <style>
        .member_tip {
            text-align: center;
            margin: 25px 0 50px;
            color: #f04344;
            font-size: 16px;
            font-weight: bolder;
        }
        .member_tip a {
            padding: 10px 15px;
            color: white;
            background: #f04344;
            text-decoration: none;
            border-radius: 5px;
        }
        .password-box {
            text-align: center;
            padding-bottom: 50px;
        }
        .password-input {
            font-size: 16px;
            border: 2px solid #cecece;
            padding: 10px;
            border-radius: 5px;
        }
        .password-box a {
            margin-left: 10px;
            padding: 10px 15px;
            color: white;
            background: #448aff;
            text-decoration: none;
            border-radius: 5px;
        }
    </style>
{% endblock %}

{% block body %}
<div class="mdui-container-fluid">
    <div class="mdui-toolbar nexmoe-item">
        <div class="loadSet">
            <a href="{{crumbs_url}}">负载磁盘<i class="mdui-icon material-icons">keyboard_arrow_down</i></a>
            <div class="small_icon_home">
                <i class="mdui-icon material-icons">storage</i>
            </div>
            <ul>
                {% for v in load_disk_list %}
                    <li>
                        <a href="javascript:void(0);" class="load_disk" data-id="{{ v.id }}">
                            {{ v.title }}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <i class="mdui-icon material-icons mdui-icon-dark" style="margin:0;">chevron_right</i>
        {% for crumbs in crumbs_list_data %}
            <a href="{{crumbs_url}}path=/{{ crumbs.path }}">{{ crumbs.name }}</a>/
        {% endfor %}
    </div>
</div>
<div class="mdui-container-fluid">
    <div class="nexmoe-item">
        <div class="mdui-row">
            <div class="member_tip">
                开通VIP拥有更多权限，无视密码，全站阅读
                <a href="javascript:void(0);" onclick="openvip()">立即开通</a>
            </div>
            <div class="password-box">
                <input id="password" class="password-input" type="text" placeholder="请输入查看密码">
                <a href="javascript:void(0);" id="get_password">确定</a>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block script %}
    <script type="application/javascript">
        $("#get_password").on("click", function () {
            var password = $("#password").val();
            $.ajax({
                url: "/drive/approve",
                type: "POST",
                dataType:  'json',
                data: {password:password, drive_id:"{{drive_id}}", path:"{{path}}"},
                success:function(e){
                    if(e.code){
                        layer.msg("密码错误");
                    }else{
                        location.reload();
                    }
                }
            })
        });

        function openvip() {
            layer.msg("啊哈，暂时还不支持自助开通，请联系站长")
        }
    </script>
{% endblock %}